#include "shm.h"

int main(){
  int shmid = shmget(SHM_KEY, SHM_SIZE, IPC_CREAT | 0664);
  if(shmid < 0){
    perror("shmget");
    exit(-1);
  }
  void* shmaddr = shmat(shmid, NULL, 0);
  if(shmaddr == NULL){
    perror("shmat");
    exit(-1);
  }
  int i = COUNT;
  while(i){
    fgets((char*)shmaddr, SHM_SIZE, stdin);
    --i;
  }
  shmdt(shmaddr);
  return 0;
}
